package com.ygxsk.carhome.ui.adapter;

import android.text.TextUtils;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.constraintlayout.widget.ConstraintLayout;

import com.blankj.utilcode.util.StringUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.flyco.roundview.RoundTextView;
import com.ygxsk.carhome.R;
import com.ygxsk.carhome.enumwrap.SignatureTaskType;
import com.ygxsk.carhome.response.FileSignatureAgreement;
import com.ygxsk.carhome.utils.CommUtils;

import java.util.List;

/*
 * @Author:itchenqi175@163.com
 * @Time:2023-10-19  14:41
 * @Description:档案内部的合同的小适配器
2023年11月3日16:35:39 整个按钮的逻辑；

IDENTIFY("identify", "认证中"),
IDENTIFIED("identified", "已认证"),

TASK_CREATED("task_created", "任务已创建"),员工端可能收不到该状态
FILL_PROGRESS("fill_progress", "填写进行中"),
员工：这两个值要显示；【预览】【作废】【员工填写按钮】【客户填写按钮】
领导：【预览】

FILL_COMPLETED("fill_completed", "填写已完成"),
员工：这两个值要显示；【预览】【作废】【员工填写按钮】【客户填写按钮】【通知领导定稿】
领导：【预览】【合同定稿】

SIGN_PROGRESS("sign_progress", "签署进行中"),
员工：【预览】【作废】【员工签署】【客户签署】
领导：【预览】【作废】【领导签署】

SIGN_COMPLETED("sign_completed", "签署已完成"),
员工：【预览】
领导：【预览】【作废】

TASK_FINISHED("task_finished", "任务已结束"),
员工：【预览】
领导：【预览】

TASK_TERMINATED("task_terminated", "任务异常停止"),
员工：【预览】
领导：【预览】

TASK_ABOLISHING("abolishing", "作废中"),
员工：【预览】
领导：【预览】

TASK_REVOKED("revoked", "任务已作废"),
员工：【预览】
领导：【预览】


 *
 */
public class FileSignatureAgreementAdapter extends BaseQuickAdapter<FileSignatureAgreement, BaseViewHolder> {

    private int extra_jumpfrom_where;

    public FileSignatureAgreementAdapter(int layoutResId, @Nullable List<FileSignatureAgreement> data, int _extra_jumpfrom_where) {
        super(layoutResId, data);

        this.extra_jumpfrom_where = _extra_jumpfrom_where;

        addChildClickViewIds(//
                R.id.textViewFileSignPartyBPhone,//拨打客户手机号的控件
                R.id.roundTextViewButton_signature_qrcode,//销售员 生成签署二维码
//                R.id.roundTextViewButton_signature_edit,//销售员 填写
                R.id.roundTextViewButton_signature_continue,//销售员 继续编辑
                R.id.roundTextViewButton_signature_cancel,//销售员+销售经理 作废合同
                R.id.roundTextViewButton_signature_preview_two,//销售员+销售经理 预览接口
                R.id.roundTextViewButton_signature_permission,//销售员 发起审批

                R.id.roundTextViewButton_signature_sure_manager,//管理层 确认发起电子合同
                R.id.roundTextViewButton_signature_signed_manager,//管理层 经理确认签署；
                R.id.roundTextViewButton_signature_cancel_manager//管理层 作废合同
//                R.id.roundTextViewButton_signature_edit_manager//管理层 填写，因为管理层也可以签署合同
        );

    }

    @Override
    protected void convert(@NonNull BaseViewHolder baseViewHolder, FileSignatureAgreement fileSignatureAgreement) {

        if (fileSignatureAgreement != null) {

            //签约时间
            String createTime = fileSignatureAgreement.getCreateTime();
            //合同的名称--合同模板的名称
            String clientName = fileSignatureAgreement.getSignTemplateName();
            //合同的状态
            String agreementStatus = fileSignatureAgreement.getSignStatus();

//            identity 身份：员工是true，经理是false
            //是否是领导或者是员工
            boolean identity = fileSignatureAgreement.isIdentity();

            //合同名称
            TextView textViewAgreementName = (TextView) baseViewHolder.getView(R.id.textViewAgreementName);
            //签约时间
            TextView textViewAgreementCreateTime = (TextView) baseViewHolder.getView(R.id.textViewAgreementCreateTime);
            //合同的状态，单个合同的状态
            TextView textViewFileSignContractStatus = (TextView) baseViewHolder.getView(R.id.textViewAgreementContractStatus);

            //销售员+销售经理 作废合同
//            RoundTextView roundTextViewButton_signature_cancel_two = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_cancel_two);
            //销售员+销售经理 预览接口--预览按钮一直在
            TextView roundTextViewButton_signature_preview_two = (TextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_preview_two);

            //底部的间隔横线
//            外侧整体包裹员工和管理层的按钮布局；
            LinearLayout linearLayoutTwoWrapButtons = (LinearLayout) baseViewHolder.getView(R.id.linearLayoutTwoWrapButtons);

//            底部包裹多个按钮的能力布局
            ConstraintLayout constraintlayout_customer_agreement = (ConstraintLayout) baseViewHolder.getView(R.id.constraintlayout_customer_agreement);
            //签署 二维码按钮
            RoundTextView roundTextViewButton_signature_qrcode = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_qrcode);
            //编辑 按钮
//            RoundTextView roundTextViewButton_signature_edit = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_edit);
            //销售员 继续编辑
            RoundTextView roundTextViewButton_signature_continue = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_continue);
            //销售员  作废 按钮
            RoundTextView roundTextViewButton_signature_cancel = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_cancel);
            //预览 按钮
//            RoundTextView roundTextViewButton_signature_preview = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_preview);
            //【发起审批】
            RoundTextView roundTextViewButton_signature_permission = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_permission);


            //包裹销售管理层的 外层布局
            ConstraintLayout constraintlayout_manager_agreement = (ConstraintLayout) baseViewHolder.getView(R.id.constraintlayout_manager_agreement);
            //【管理层-确认发起电子签署】
            RoundTextView roundTextViewButton_signature_sure_manager = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_sure_manager);
            //【管理层的】作废按钮
            RoundTextView roundTextViewButton_signature_cancel_manager = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_cancel_manager);
            //管理层的 预览 接口
//            RoundTextView roundTextViewButton_signature_preview_manager = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_preview_manager);
            //管理层 填写，因为管理层 也能
//            RoundTextView roundTextViewButton_signature_edit_manager = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_edit_manager);
            //管理层 签署完毕，最后一步 经理签署，经理签署完毕，就是签署任务完成；
            RoundTextView roundTextViewButton_signature_signed_manager = (RoundTextView) baseViewHolder.getView(R.id.roundTextViewButton_signature_signed_manager);

            //合同名称
            CommUtils.setText(textViewAgreementName, clientName);
            //签约时间
            CommUtils.setText(textViewAgreementCreateTime, createTime);
            //乙方电话
            CommUtils.setText(textViewFileSignContractStatus, agreementStatus);


            //合同的状态
//                    IDENTIFY("identify", "认证中"),
//                    IDENTIFIED("identified", "已认证"),
//                    TASK_CREATED("task_created", "任务已创建"),
//                    FILL_PROGRESS("fill_progress", "填写进行中"),1
//                    FILL_COMPLETED("fill_completed", "填写已完成"),1
//                    SIGN_PROGRESS("sign_progress", "签署进行中"),1
//                    SIGN_COMPLETED("sign_completed", "签署已完成"),1
//                    TASK_FINISHED("task_finished", "任务已结束"),1
//                    TASK_TERMINATED("task_terminated", "任务异常停止"),1
//                    TASK_ABOLISHING("abolishing", "作废中"),
//                    TASK_REVOKED("revoked", "任务已作废"),

            // 如果是历史记录进来的，那么只有【预览】按钮
//            if (extra_jumpfrom_where == ExtraValue.VALUE_JUMPFROM_SIGNATURE_ACTIVITY_ONITEM_CLICK_INTO) {
//
//               //正常的管理页进入
            //作废 不处理，让底部的状态自己处理
//                CommUtils.setViewGone(roundTextViewButton_signature_cancel_two);
            linearLayoutTwoWrapButtons.setVisibility(View.VISIBLE);

//              identity 身份：员工是true，经理是false
            if (identity) {

                //如果是员工身份
                constraintlayout_customer_agreement.setVisibility(View.VISIBLE);
                constraintlayout_manager_agreement.setVisibility(View.GONE);

                //发起签约，按钮是根据状态来的
                String result = StringUtils.getString(R.string.bracket_left) + agreementStatus + StringUtils.getString(R.string.bracket_right);

                if (TextUtils.equals(agreementStatus, SignatureTaskType.IDENTIFY.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.IDENTIFY.getValue() + result);

                    //待认证 状态 三个按钮都在
//                      IDENTIFY("identify", "认证中"),

                    //作废按钮
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel);

                    //【客户填写】
                    CommUtils.setViewGone(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_customer_input));

                    //【员工填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue));

                    //发起审批
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.IDENTIFIED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.IDENTIFIED.getValue() + result);

//                      IDENTIFIED("identified", "已认证"),
                    //作废按钮
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel);

                    //【客户填写】
                    CommUtils.setViewGone(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_customer_input));

                    //【员工填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue));

                    //发起审批
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_CREATED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_CREATED.getValue() + result);
//                    TASK_CREATED("task_created", "任务已创建"),
                    //【预览】
                    //【作废】
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel);

                    //【客户填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_customer_input));

                    //【员工填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.FILL_PROGRESS.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.FILL_PROGRESS.getValue() + result);
//                      FILL_PROGRESS("fill_progress", "填写进行中"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel);

                    //【客户填写】--客户有第一次填写信息
                    CommUtils.setViewVisible(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_customer_input));

                    //【员工填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.FILL_COMPLETED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.FILL_COMPLETED.getValue() + result);
//                    FILL_COMPLETED("fill_completed", "填写已完成"),
                    //【预览】
                    //【作废】
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel);

                    //【客户填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_customer_input));

                    //【员工填写】
                    CommUtils.setViewVisible(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue));

                    //【通知领导定稿】
                    CommUtils.setViewVisible(roundTextViewButton_signature_permission);


                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.SIGN_PROGRESS.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.SIGN_PROGRESS.getValue() + result);
//                    SIGN_PROGRESS("sign_progress", "签署进行中"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel);

                    //【客户签署】
                    CommUtils.setViewVisible(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_input_customer_signatrue));

                    //【员工签署】
                    CommUtils.setViewVisible(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue_signatrue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.SIGN_COMPLETED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.SIGN_COMPLETED.getValue() + result);
//                    SIGN_COMPLETED("sign_completed", "签署已完成"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel);

                    //【客户签署】
                    CommUtils.setViewVisible(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_input_customer_signatrue));

                    //【员工签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue_signatrue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_FINISHED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_FINISHED.getValue() + result);
//                    TASK_FINISHED("task_finished", "任务已结束"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel);

                    //【客户签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_input_customer_signatrue));

                    //【员工签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue_signatrue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_TERMINATED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_TERMINATED.getValue() + result);
//                    TASK_TERMINATED("task_terminated", "任务异常停止"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel);

                    //【客户签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_input_customer_signatrue));

                    //【员工签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue_signatrue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_ABOLISHING.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_ABOLISHING.getValue() + result);

//                    TASK_ABOLISHING("abolishing", "作废中"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel);

                    //【客户签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_input_customer_signatrue));

                    //【员工签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue_signatrue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);


                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_REVOKED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_REVOKED.getValue() + result);

//                    TASK_REVOKED("revoked", "任务已作废"),
                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel);

                    //【客户签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_qrcode);
                    roundTextViewButton_signature_qrcode.setText(StringUtils.getString(R.string.button_edit_right_input_customer_signatrue));

                    //【员工签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_continue);
                    roundTextViewButton_signature_continue.setText(StringUtils.getString(R.string.button_edit_right_input_continue_signatrue));

                    //【通知领导定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_permission);

                }

            } else {

                //如果是【领导身份】
                constraintlayout_customer_agreement.setVisibility(View.GONE);
                constraintlayout_manager_agreement.setVisibility(View.VISIBLE);

                //发起签约，按钮是根据状态来的
//                    String result = StringUtils.getString(R.string.bracket_left) + agreementStatus + StringUtils.getString(R.string.bracket_right);

                if (TextUtils.equals(agreementStatus, SignatureTaskType.IDENTIFY.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.IDENTIFY.getValue());
//                    IDENTIFY("identify", "认证中"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);


                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.IDENTIFIED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.IDENTIFIED.getValue());
//                    IDENTIFIED("identified", "已认证"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_CREATED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_CREATED.getValue());
//                    TASK_CREATED("task_created", "任务已创建"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.FILL_PROGRESS.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.FILL_PROGRESS.getValue());
//                    FILL_PROGRESS("fill_progress", "填写进行中"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.FILL_COMPLETED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.FILL_COMPLETED.getValue());
//                    FILL_COMPLETED("fill_completed", "填写已完成"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewVisible(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.SIGN_PROGRESS.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.SIGN_PROGRESS.getValue());
//                    SIGN_PROGRESS("sign_progress", "签署进行中"),


                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                    //领导签署
                    CommUtils.setViewVisible(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.SIGN_COMPLETED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.SIGN_COMPLETED.getValue());
//                    SIGN_COMPLETED("sign_completed", "签署已完成"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewVisible(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_FINISHED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_FINISHED.getValue());
//                    TASK_FINISHED("task_finished", "任务已结束"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_TERMINATED.getIndex())) {
                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_TERMINATED.getValue());
                    //TASK_TERMINATED("task_terminated", "任务异常停止"),

                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);


                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_ABOLISHING.getIndex())) {
                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_ABOLISHING.getValue());
//                    TASK_ABOLISHING("abolishing", "作废中"),
                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                } else if (TextUtils.equals(agreementStatus, SignatureTaskType.TASK_REVOKED.getIndex())) {

                    CommUtils.setText(textViewFileSignContractStatus, SignatureTaskType.TASK_REVOKED.getValue());

//                       TASK_REVOKED("revoked", "任务已作废"),
                    //【预览】
                    //【作废】
                    CommUtils.setViewGone(roundTextViewButton_signature_cancel_manager);

                    //【合同定稿】
                    CommUtils.setViewGone(roundTextViewButton_signature_sure_manager);

                    //【领导签署】
                    CommUtils.setViewGone(roundTextViewButton_signature_signed_manager);

                }
            }


//            }
//            else if (extra_jumpfrom_where == ExtraValue.VALUE_JUMPFROM_SIGNATURE_HISTROY_ACTIVITY_ONITEM_CLICK_INTO) {
//
//                //历史记录进入，只有预览按钮；其余底部布局都是隐藏的
//
//                //作废 隐藏
//                CommUtils.setViewGone(roundTextViewButton_signature_cancel_two);
//                //两层包裹隐藏
//                linearLayoutTwoWrapButtons.setVisibility(View.GONE);
//            }

        }

    }
}
